/*
 * clog_thread_category.h
 *
 *  Created on: 2012-8-20
 *      Author: lin
 */

#ifndef CLOG_THREAD_CATEGORY_H_
#define CLOG_THREAD_CATEGORY_H_

#include "def/defs.h"
#include  "collection/array_list.h"
#include "clog_level.h"

#include "clog_conf.h"
typedef struct{
    uint64_t level_mask;
    array_list_t *fit_rules;
    uint16_t name_len;
    char name[0];
}clog_thread_category_t;

clog_thread_category_t *clog_thread_category_new(const char *category_name,clog_conf_t *conf);
void clog_thread_category_free(clog_thread_category_t *t_cat);
static inline int clog_thread_category_logable(clog_thread_category_t *t_cat,uint16_t level){
    return t_cat->level_mask << (CLOG_MAX_LEVEL -level);
}
#endif /* CLOG_THREAD_CATEGORY_H_ */
